fix(openai-compat): inherit static thinking support#3849
Conversation
|
This pull request targeted The base branch has been automatically changed to |
There was a problem hiding this comment.
Code Review
This pull request refactors the thinking configuration logic in buildOpenAICompatibilityConfigModels into a new helper function openAICompatibilityModelThinking, allowing models to inherit thinking support from static registry definitions when available. Unit tests have been added to verify this inheritance, default fallback behavior, and explicit configuration preservation. The review feedback points out a potential issue where returning a direct pointer to the static registry's ThinkingSupport could expose global shared state to accidental mutation, and suggests performing a deep copy of the struct and its slice to prevent this.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
This pull request targeted The base branch has been automatically changed to |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f9241f9a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9eb8647b58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c1a30bd32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07236d6ea0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6a346e677
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40dfebeb4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5727d89724
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| for modelID, levels := range pooled { | ||
| if len(levels) == 0 { | ||
| pooled[modelID] = defaultOpenAICompatibilityThinkingLevels() |
There was a problem hiding this comment.
Do not widen empty pooled thinking intersections
When duplicate OpenAI-compatible aliases have explicit non-overlapping thinking.levels, this fallback replaces the empty intersection with the default low, medium, high set. For a pool like shared -> m1 with only xhigh and shared -> m2 with only low, requests such as shared(medium) now pass validation even though no upstream in the pool advertises that level, so the executor can forward an unsupported reasoning_effort depending on which pool member is selected. Keep the intersection empty (or disable thinking for the pool) instead of widening it to defaults.
Useful? React with 👍 / 👎.
Summary
Fix OpenAI-compatible configured models so they inherit thinking/reasoning support from the static model registry when available.
Previously, OpenAI-compatible models without explicit
thinkingconfig always defaulted to:That caused models such as
gpt-5.5, which already supportxhighin the static registry, to reject valid Codex/Responses requests usingreasoning.effort = xhighbefore forwarding to the upstream provider.Changes
thinkingconfig as the highest priority.thinking, look up the static model definition by upstream model name.low/medium/highdefault for unknown models.Why
This preserves the current conservative fallback for unknown OpenAI-compatible models, while allowing known models like
gpt-5.5to use their declared static capabilities such asxhigh.Tests